<?php

//spl_autoload_register("__autoload");
spl_autoload_register(function($class){

    $file = __DIR__.'/var-dumper/'.strtr(str_replace("Symfony\\Component\\VarDumper\\",'',$class),'\\', '/').'.php';
    if(file_exists($file)) {
        require_once $file;
    }
}, true, true);

if (! function_exists('dd')) {
    function dd()
    {
        array_map(function ($x) {
            $htmlDumper = new \Symfony\Component\VarDumper\Dumper\HtmlDumper();
            $varCloner = new \Symfony\Component\VarDumper\Cloner\VarCloner();
            $htmlDumper->dump($varCloner->cloneVar($x));
        }, func_get_args());

        die(1);
    }
}
if (! function_exists('dump')) {
    function dump()
    {
        array_map(function ($x) {
            $htmlDumper = new \Symfony\Component\VarDumper\Dumper\HtmlDumper();
            $varCloner = new \Symfony\Component\VarDumper\Cloner\VarCloner();
            $htmlDumper->dump($varCloner->cloneVar($x));
        }, func_get_args());
    }
}


